package com.molichuxing.gateway.api.services.impl;

import com.molichuxing.framework.result.ResponseCodeEnum;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.api.services.MonitorApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags="监控接口(用于监控是否运行)")
@RequestMapping(value = "/monitor")
public class MonitorApiServiceImpl extends RootApiService implements MonitorApiService {
	private static final Logger logger = LoggerFactory.getLogger(MonitorApiServiceImpl.class);

	@Override
	@ApiOperation(value = "监控接口")
	@GetMapping(value = "/index", produces = { "application/json;charset=UTF-8" })
	public ResponseResult<String> index() {
		logger.info("我还活着！");
		ResponseResult<String> resRst = new ResponseResult<>();
		resRst.setCode(ResponseCodeEnum.SUCCESS.getCode());
		resRst.setMessage("我还活着！");
		return resRst;
	}

}
